{extend name="layout/layout" /}

{block name="content"}
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 申领样品详情</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form id="ajax-form" action="{:url('admin/'.strtolower($model).'/editpost')}" class="form-horizontal validation-form" method="post" enctype="multipart/form-data">
                    {:token()}
                    <div class="form-body">
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        订单号
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$order.orderNO} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        状态
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$order.status} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {if condition="($order.status == '拒绝发货')"}
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        拒绝发货原因
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$order.mcontent} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/if}
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        产品名
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$orderitem.productName} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        图片
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <div id="upload-image">
                                            <span data-multi="false">
                                                <img src="{$orderitem.productImg}" style="width: 100px;height: 100px;" />
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        产地
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$order.cityname}->{$order.xianname}->{$order.townname}{if condition="$order.villagename"}->{$order.villagename}{/if} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        领取规格
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$orderitem.count}{$orderitem.unitname} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        收货人
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$order.userName} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        收货地址
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static">
                                            {$order.deliverAddress}
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        邮编
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static">
                                            {$order.mail}
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        联系方式
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static">
                                            {$order.userPhone}
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        留言
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static">
                                            {$order.content}
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {if  condition="($order.status == '待收货')"}
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        快递公司
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static">
                                            {$order.expressName}
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        快递单号
                                        <span class="required">：</span>
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static">
                                            {$order.expressNo}
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/if}
                    </div>

                    <input type="hidden" name="id" value="{$order.id}">
                    <hr />
                    <div class="row">
                        <div class="form-actions">
                            <div class="col-md-offset-2 col-md-10">
                                {if condition="($order.status == '待发货')"}
                                <button type="button" data-typebutton="1" class="btn blue save-btn">
                                    发货 <i class="fa fa-send"></i>
                                </button>
                                <button type="button" data-typebutton="2" class="btn red save-btn">
                                    拒绝 <i class="fa fa-times"></i>
                                </button>
                                {/if}
                                <button type="button" class="btn default" onclick="history.go(-1);">
                                    返回 <i class="fa fa-mail-forward"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</div>

<input type="hidden" class="delivery_url" value="{:url('admin/Receiveorder/delivery')}">
<input type="hidden" class="refuse_url" value="{:url('admin/Receiveorder/refuse')}">
{/block}

{block name="pagescript"}
<script src="__STATIC__/admin/pages/js/receiveorder.js?v={:time()}" type="text/javascript"></script>
{/block}